#include "pitches.h"

int melody[] = {
  NOTE_C4,NOTE_C4,NOTE_G4,NOTE_G4,NOTE_A4,NOTE_A4,NOTE_G4,
  NOTE_F4,NOTE_F4,NOTE_E4,NOTE_E4,NOTE_D4,NOTE_D4,NOTE_C4,
  NOTE_G4,NOTE_G4,NOTE_F4,NOTE_F4,NOTE_E4,NOTE_E4,NOTE_D4,
  NOTE_G4,NOTE_G4,NOTE_F4,NOTE_F4,NOTE_E4,NOTE_E4,NOTE_D4,
  NOTE_C4,NOTE_C4,NOTE_G4,NOTE_G4,NOTE_A4,NOTE_A4,NOTE_G4,
  NOTE_F4,NOTE_F4,NOTE_E4,NOTE_E4,NOTE_D4,NOTE_D4,NOTE_C4,
};

int noteTypes[] = {
  2,2,4.5,4.5,5.5,5.5,4.5,
  3.5,3.5,2.5,2.5,2,2,2,
  5,5,4,4,3,3,2,
  5,5,4,4,3,3,2,
  1,1,5,5,6,6,5,
  4,4,3,3,2,2,1,
};
void setup() {
  // put your setup code here, to run once:
  for(int thisNote = 0;thisNote < 42;thisNote++){
    double noteDuration = 1000/noteTypes[thisNote];
    tone(8,melody[thisNote],noteDuration);
    double pauseBetweenNotes = noteDuration*1.40;
    delay(pauseBetweenNotes);
    noTone(8);
  }
}

void loop() {
  // put your main code here, to run repeatedly:

}
